/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author owtee
 */
@Entity
@Table(name = "job_details")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "JobDetails.findAll", query = "SELECT j FROM JobDetails j"),
    @NamedQuery(name = "JobDetails.findByDetailId", query = "SELECT j FROM JobDetails j WHERE j.detailId = :detailId"),
    @NamedQuery(name = "JobDetails.findByDescription", query = "SELECT j FROM JobDetails j WHERE j.description = :description"),
    @NamedQuery(name = "JobDetails.findByActiveFlag", query = "SELECT j FROM JobDetails j WHERE j.activeFlag = :activeFlag"),
    @NamedQuery(name = "JobDetails.findByCreateUser", query = "SELECT j FROM JobDetails j WHERE j.createUser = :createUser"),
    @NamedQuery(name = "JobDetails.findByCreateDate", query = "SELECT j FROM JobDetails j WHERE j.createDate = :createDate"),
    @NamedQuery(name = "JobDetails.findByModifyUser", query = "SELECT j FROM JobDetails j WHERE j.modifyUser = :modifyUser"),
    @NamedQuery(name = "JobDetails.findByModifyDate", query = "SELECT j FROM JobDetails j WHERE j.modifyDate = :modifyDate")})
public class JobDetails implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "Detail_Id")
    private Integer detailId;
    @Size(max = 255)
    @Column(name = "Description")
    private String description;
    @Column(name = "Active_Flag")
    private Boolean activeFlag;
    @Size(max = 10)
    @Column(name = "Create_User")
    private String createUser;
    @Column(name = "Create_Date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createDate;
    @Size(max = 10)
    @Column(name = "Modify_User")
    private String modifyUser;
    @Column(name = "Modify_Date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date modifyDate;
    @JoinColumn(name = "Item_Id", referencedColumnName = "Item_Id")
    @ManyToOne(optional = false)
    private JobItems itemId;
    @JoinColumn(name = "Action_Id", referencedColumnName = "Action_Id")
    @ManyToOne(optional = false)
    private JobAction actionId;
    @JoinColumn(name = "Job_Id", referencedColumnName = "Job_Id")
    @ManyToOne(optional = false)
    private Jobs jobId;

    public JobDetails() {
    }

    public JobDetails(Integer detailId) {
        this.detailId = detailId;
    }

    public Integer getDetailId() {
        return detailId;
    }

    public void setDetailId(Integer detailId) {
        this.detailId = detailId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Boolean getActiveFlag() {
        return activeFlag;
    }

    public void setActiveFlag(Boolean activeFlag) {
        this.activeFlag = activeFlag;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getModifyUser() {
        return modifyUser;
    }

    public void setModifyUser(String modifyUser) {
        this.modifyUser = modifyUser;
    }

    public Date getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }

    public JobItems getItemId() {
        return itemId;
    }

    public void setItemId(JobItems itemId) {
        this.itemId = itemId;
    }

    public JobAction getActionId() {
        return actionId;
    }

    public void setActionId(JobAction actionId) {
        this.actionId = actionId;
    }

    public Jobs getJobId() {
        return jobId;
    }

    public void setJobId(Jobs jobId) {
        this.jobId = jobId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (detailId != null ? detailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof JobDetails)) {
            return false;
        }
        JobDetails other = (JobDetails) object;
        if ((this.detailId == null && other.detailId != null) || (this.detailId != null && !this.detailId.equals(other.detailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.JobDetails[ detailId=" + detailId + " ]";
    }
    
}
